Add a canary setting to avoid caching AST viewer queries#818
Merged
adityasharad merged 1 commit intomainfrom Apr 1, 2021
Merged
Add a canary setting to avoid caching AST viewer queries#818adityasharad merged 1 commit intomainfrom
adityasharad merged 1 commit intomainfrom
Conversation
adityasharad
approved these changes
Apr 1, 2021
Contributor
adityasharad
left a comment
There was a problem hiding this comment.
Code LGTM, one suggestion on setting groups. We could add an "advanced users" section to the public docs.
| /** | ||
| * Avoids caching in the AST viewer if the user is also a canary user. | ||
| */ | ||
| export const NO_CACHE_AST_VIEWER = new Setting('noCacheAstViewer', ROOT_SETTING); |
Contributor
There was a problem hiding this comment.
Would it make sense to have an astViewer or viewAst parent setting, and then a noCache or disableCache underneath it? Not sure if we expect future AST viewer-related options.
Contributor
Author
There was a problem hiding this comment.
I like that better. Made the change.
When codeql library developers are working on PrintAST queries, it is not easy to use the AST Viewer. The AST Viewer caches results so that multiple calls to view the AST of the same file are nearly instantaneous. However, this breaks down if you are changing the actual queries that perform AST viewing. In this case, you do not want the cache to be active. This commit adds an undocumented setting that prevents caching. To enable, set: ``` "codeQL.isCanary": true, "codeQL.astViewer.disableCache": true ``` Note that *both* settings must be true for this to work. This behaviour and all canary behaviour should be documented somewhere. I will add that later.
f80ae38 to
3f52e25
Compare
Contributor
Author
|
I'll document it internally. |
aofaof0907
pushed a commit
to aofaof0907/vscode-codeql
that referenced
this pull request
Jul 27, 2021
When codeql library developers are working on PrintAST queries, it is not easy to use the AST Viewer. The AST Viewer caches results so that multiple calls to view the AST of the same file are nearly instantaneous. However, this breaks down if you are changing the actual queries that perform AST viewing. In this case, you do not want the cache to be active. This commit adds an undocumented setting that prevents caching. To enable, set: ``` "codeQL.isCanary": true, "codeQL.astViewer.disableCache": true ``` Note that *both* settings must be true for this to work. This behaviour and all canary behaviour should be documented somewhere. I will add that later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When codeql library developers are working on PrintAST queries, it is
not easy to use the AST Viewer. The AST Viewer caches results so that
multiple calls to view the AST of the same file are nearly
instantaneous.
However, this breaks down if you are changing the actual queries that
perform AST viewing. In this case, you do not want the cache to be
active.
This commit adds an undocumented setting that prevents caching. To
enable, set:
Note that both settings must be true for this to work.
This behaviour and all canary behaviour should be documented somewhere.
I will add that later.
Any suggestions on where this should go would be appreciated.
Checklist
@github/docs-content-codeqlhas been cc'd in all issues for UI or other user-facing changes made by this pull request.